# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.utils.deprecation import MiddlewareMixin

class Test(MiddlewareMixin):
    def process_request(self, request):
        print("这是一个中间件 --> test")
        ####在这里做一个认证，如果不是负责人或者项目经理，无法对本项目任务或者实验进行修改或者删除

    def process_view(self, request, callback, callback_args, callback_kwargs):
        print("M2.process_view")

    def process_response(self, request, response):
        print('M2.response')
        return response

    def process_exception(self, request, exception):
        print('M2的process_exception')

        return HttpResponse("出现了异常")
